package com.bjpowernode.mapstruct.two;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface BillConvert {
    BillConvert convert = Mappers.getMapper(BillConvert.class);
    @Mappings({
            @Mapping(source = "person.name",target="customerName"),
            @Mapping(source = "shopOrder.name",target="orderName"),
            @Mapping(source = "shopOrder.money",target="orderMoney")
    })
    Bill toBill(Person person,ShopOrder shopOrder);
}
